# -*- coding:utf-8 -*-
from database.db_handler import MysqlHander
from database.db_business import DbBusiness
from common.my_http import MyHttp
from common.my_baidu import MyBaidu
from common.my_time import MyTime
from common.macro_data import MacroData
from common.my_file import MyFile
import urllib.request
from bs4 import BeautifulSoup
from base_macro import MacroBase
import glob
import jieba
import re
import threading
import hashlib
import urllib.parse
import time
import os


'''
网络数据
'''


class BaiduHaiguanTongji(MacroBase):
    def __init__(self, file_name):
        pass

    def __del__(self):
        pass
        
    
    def set_param(self):
        self.set_check_title(False)
        self.set_type(901)
        self.set_max_page(6) 
        self.set_forward(30)
    
    def do_query(self):
        self.set_param()    
        self.get_data(["海关总署"], [["海关总署"],[":"]], ["?",";"])
        self.get_data(["海关统计"], [["海关统计"],[":"]], ["?",";"])
        self.get_data(["海关数据"], [["海关数据"],[":"]], ["?",";"])


def haiguan_tongji_api():
    d = BaiduHaiguanTongji('./out/' + os.path.split(__file__)[-1].split(".")[0] + ".log")
    d.do_query()

if __name__ == '__main__':
    haiguan_tongji_api()
